package com.prjsystem.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.prjsystem.common.constant.CMSConstant;
import com.prjsystem.entity.CVSBean;
import com.prjsystem.entity.WorkRequestViewBean;
import com.prjsystem.service.CVSService;

public class CVSAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6478012924263810885L;
	private CVSService cvsService;
	private CVSBean cvsBean = new CVSBean();

	public String init () {
		return SUCCESS;
	}
	//一览界面
	public String seachCvsInfo() throws Exception {
		ActionContext ctx = ActionContext.getContext();
		ctx.getSession().put(CMSConstant.cvsBean,cvsBean);
		cvsService.getCvsView(cvsBean);
		return SUCCESS;
	}
	public String cvsBack() throws Exception {
		cvsBean= (CVSBean) ActionContext.getContext().getSession().get(CMSConstant.cvsBean);
		cvsService.getCvsView(cvsBean);
		return SUCCESS;
    }
	//add添加界面
	public String addDefault () throws Exception {
		cvsService.searchCvsList(cvsBean);
		return SUCCESS;
	}
	//editCVS
	public String editCVS(){
		cvsService.searchCvsInfoByCvsId(cvsBean);
		return SUCCESS;
	}
	//LookCVS
	public String lookCVS(){
		cvsService.searchCvsInfoByCvsId(cvsBean);
		return SUCCESS;
	}
	//deleteCVS
	public String deleteCVS(){
		cvsService.deleteCVS(cvsBean);
		return SUCCESS;
	}
	
	public CVSService getCvsService() {
		return cvsService;
	}
	public void setCvsService(CVSService cvsService) {
		this.cvsService = cvsService;
	}
	public CVSBean getCvsBean() {
		return cvsBean;
	}
	public void setCvsBean(CVSBean cvsBean) {
		this.cvsBean = cvsBean;
	}
	
}
